package com.itheima.properties;

import java.io.*;
import java.util.Properties;

public class Demo {
    public static void main(String[] args) throws IOException {
        //Properties和IO流相结合,实现本地文件的读写
        Properties prop = new Properties();
        prop.setProperty("zhangsan","23");
        prop.setProperty("lisi","24");
        prop.setProperty("wangwu","25");

        BufferedWriter bf = new BufferedWriter(new FileWriter("test_io流\\prop.properties"));
        prop.store(bf,null);
        bf.close();

        BufferedReader br = new BufferedReader(new FileReader("test_io流\\prop.properties"));
        //load从输入字符流读取属性列表（键和元素对）
        prop.load(br);
        br.close();
        System.out.println(prop);
    }
}
